#include<algorithm>
#include<iostream>
using namespace std;
const int N = 50;
int a[N], b[N];
int n, fa, fb, la, lb;
bool cmp(int a, int b)
{
    return a > b;
}
void solve()
{
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> b[i];
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    sort(a + 1, a + n + 1, cmp);
    sort(b + 1, b + n + 1, cmp);
    fa = fb = 1;
    la = lb = n;
    int ans = 0;
    for (int i = 1; i <= n; i++)
    {
        if (a[fa] > b[fb])
        {
            ans++;
            fa++, fb++;
        }
        else if (a[la] > b[lb])
        {
            ans++;
            la--, lb--;
        }
        else
        {
            if (a[la] < b[fb])
            {
                ans--;
                la--, fb++;
            }
        }
    }
    cout << ans << endl;
}
